/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2019-02-13 Time: 23:04
 *
 */

import global from "./global";

export const RequestType = {
  Product: 'Product', // 正式环境
  Product_spare: 'Product_spare', // 正式环境
  Develop: 'Develop', // 开发环境
  Debug: 'Debug',

}

export const requestType = RequestType.Develop

// 正式环境
export const ProductAPIUrl = '';
// 备用环境
export const ProductAPIUrl_spare = '';
// 开发环境
export const DevelopAPIUrl ='http://124.93.247.100:8082/huasheng/qms/mobile';

export const DebugAPIUrl = ''

export const ApiPath = (requestType) => {
  switch (requestType) {
    case RequestType.Product: {
      return ProductAPIUrl
    }
    case RequestType.Product_spare: {
        return ProductAPIUrl_spare
    }
    case RequestType.Develop: {
      return DevelopAPIUrl
    }
    case RequestType.Debug: {
      return DebugAPIUrl
    }
  }
}

export function AppRequestPath(){
  return global.AppRequestPath;
}

export function ContextPath(){
    return global.AppRequestPath.replace("/qms/mobile","");
}


